import request from '@/config/axios'

// 获取企业授权码
export const getCorpAuthUrl = async () => {
  return await request.get({ url: `/wecom/we-com-api-config/get-corp-auth-url` })
}

// 查询企微员工详情
export const getWeUser = async (id: number) => {
  return await request.get({ url: `/wecom/we-user/get?id=` + id })
}

// 新增企微员工
export const createWeUser = async (data: WeUserVO) => {
  return await request.post({ url: `/wecom/we-user/create`, data })
}

// 修改企微员工
export const updateWeUser = async (data: WeUserVO) => {
  return await request.put({ url: `/wecom/we-user/update`, data })
}

// 删除企微员工
export const deleteWeUser = async (id: number) => {
  return await request.delete({ url: `/wecom/we-user/delete?id=` + id })
}

// 导出企微员工 Excel
export const exportWeUser = async (params) => {
  return await request.download({ url: `/wecom/we-user/export-excel`, params })
}

// 获取部门树
export const getSimpleDeptList = async () => {
  return await request.get({ url: `/wecom/we-dept/simple-list` })
}

// 同步企微员工
export const syncUser = async () => {
  return await request.post({ url: `/wecom/we-user/sync-user` })
}
// 获取通讯录授权链接
export const getContactAuthUrl = async () => {
  return await request.get({ url: `/wecom/we-com-api-config/get-contact-auth-url` })
}
// 获取获客助手授权码
export const getAcqAuthUrl = async () => {
  return await request.get({ url: `/wecom/we-com-api-config/get-acq-auth-url` })
}

// 授权开启数据与智能专区-会话存档
export const bindDataAuth = async () => {
  return await request.post({ url: `/wecom/we-com-api-config/bind-data-auth` })
}
